package cn.bytets.rpc.api.code;

import cn.bytets.rpc.api.Channel;
import cn.bytets.rpc.api.serialize.RpcSerialize;

import java.io.IOException;

/**
 * 编解码,可以定义成SPI可扩展接口类
 */
public interface Codec {

    public void encode(Object msg, ChannelByteBuf byteBuf, RpcSerialize serialize, Channel channel);

    public Object decoder(ChannelByteBuf byteBuf,RpcSerialize serialize,Channel channel) throws IOException, ClassNotFoundException;
}
